package i2.application.fmw.aspects;

import i2.application.fmw.exceptions.ValidationException;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.AfterThrowing;
import org.aspectj.lang.annotation.Aspect;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@Aspect
public class ValidationExceptionAspect {

	private static final Logger logger = LoggerFactory.getLogger(ValidationExceptionAspect.class);
	
	
	@AfterThrowing(
			pointcut = "execution(* i2.application.checklist.service.impl.* (..))",
			throwing = "e"				)
	public void execMethodeSM(JoinPoint pjp, ValidationException e)  {
		logger.info("================="+pjp.getTarget()+pjp.getSignature().getName());
		logger.info("=================");
		logger.error("{}"+pjp.getTarget(), e.getMessage());
		logger.info("=================");
	}
}

